#pragma once


#include <string>

namespace helper {
namespace sqlite {

class Value {
public:
  Value(void * stmt, int index);
  ~Value();

  bool isNull() const;
  bool isInteger() const;
  bool isReal() const;
  bool isString() const;
  bool isBinary() const;

  int64_t length() const;

  int64_t integer() const;
  double real() const;

  std::string string() const;
  void string(std::string & str) const ;
  size_t string(char * buf, size_t len) const;

  std::string binary() const;
  void binary(std::string & str ) const ;
  size_t binary(char * buf, size_t len) const;

private:
  void * _stmt;
  int _index;
};

}//namespace sqlite
}//namespace helper
